package com.examplemartin.jpademo.service.pur;

import com.examplemartin.jpademo.dao.PurDetailDao;
import com.examplemartin.jpademo.pojo.po.purchase.PurDetailPO;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Component
public class PurDetailService {
    @Resource
    private PurDetailDao purDetailDao;

    public PurDetailPO save(PurDetailPO purDetailPO){
        PurDetailPO save = purDetailDao.save(purDetailPO);
        return save;
    }

    // 按id查找
    public PurDetailPO findById(Long id){
        return purDetailDao.findById(id).get();
    }

    // 删除明细  -- 这里偷懒了
    public void deleteById(Long id){
        purDetailDao.deleteById(id);
    }
}
